package com.cloud.business.service.sys;

import com.baomidou.mybatisplus.core.metadata.IPage;
import com.cloud.business.entity.sys.SysUser;
import com.cloud.business.model.commonvm.DataDropDown;
import com.cloud.business.model.commonvm.DeletePost;
import com.cloud.business.model.commonvm.ResultMsg;
import com.cloud.business.model.sys.sysuservm.LoginPost;
import com.cloud.business.model.sys.sysuservm.SysUserModel;
import com.cloud.business.model.sys.sysuservm.SysUserQueryModel;
import com.cloud.business.model.sys.sysuservm.UpdPwdPost;

import java.util.List;

/**
 * <p>
 * 系统用户 服务类
 * </p>
 *
 * @author dh
 * @since 2020-03-21
 */
public interface ISysUserService {
    /**
     * 分页列表
     *
     * @param sysUserQueryModel
     * @param page
     * @param msg
     * @throws Exception
     */
    void getListByPage(SysUserQueryModel sysUserQueryModel, IPage<SysUserModel> page, ResultMsg msg) throws Exception;

    /**
     * 创建
     *
     * @param sysUserModel
     * @return
     * @throws Exception
     */
    Integer create(SysUserModel sysUserModel, ResultMsg msg) throws Exception;

    /**
     * 更新
     *
     * @param sysUserModel
     * @return
     * @throws Exception
     */
    Integer update(SysUserModel sysUserModel, ResultMsg msg) throws Exception;

    /**
     * 获取单条
     *
     * @param operationId
     * @param objectId
     * @return
     * @throws Exception
     */
    SysUser getById(Integer operationId, Integer objectId, ResultMsg msg) throws Exception;

    /**
     * 批量删除
     *
     * @param deletePost
     * @return
     * @throws Exception
     */
    int deleteByList(DeletePost deletePost, ResultMsg msg) throws Exception;

    /**
     * 登陆
     *
     * @param loginPost
     * @param msg
     * @return
     * @throws Exception
     */
    SysUserModel login(LoginPost loginPost, ResultMsg msg) throws Exception;

    /**
     * 更新密码
     *
     * @param updPwdPost
     * @param msg
     * @return
     * @throws Exception
     */
    Integer updPassword(UpdPwdPost updPwdPost, ResultMsg msg) throws Exception;

    /**
     * 重置密码
     *
     * @param operationId
     * @param objectId
     * @param msg
     * @return
     * @throws Exception
     */
    Integer resetPwd(Integer operationId, Integer objectId, ResultMsg msg) throws Exception;

    /**
     * 按照角色/类型获取用户
     *
     * @param operationId
     * @param RoleCode
     * @param EnumType
     * @param msg
     * @return
     * @throws Exception
     */
    List<SysUser> getListByEnumtype(Integer operationId, String RoleCode, String EnumType, ResultMsg msg) throws Exception;

    /**
     * 根据角色code获取用户集合下拉
     *
     * @param operationId
     * @param roleCode
     * @param msg
     * @return
     * @throws Exception
     */
    List<DataDropDown> getUsersByRoleCode(Integer operationId, String roleCode, ResultMsg msg) throws Exception;

    /**
     * 获取下拉列表
     *
     * @param operationId
     * @param msg
     * @return
     * @throws Exception
     */
    List<DataDropDown> getDropDownList(Integer operationId, ResultMsg msg) throws Exception;

}
